{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "pd.set_option(\"display.precision\", 2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>KS</td>\n",
       "      <td>128</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>25</td>\n",
       "      <td>265.1</td>\n",
       "      <td>110</td>\n",
       "      <td>45.07</td>\n",
       "      <td>197.4</td>\n",
       "      <td>99</td>\n",
       "      <td>16.78</td>\n",
       "      <td>244.7</td>\n",
       "      <td>91</td>\n",
       "      <td>11.01</td>\n",
       "      <td>10.0</td>\n",
       "      <td>3</td>\n",
       "      <td>2.70</td>\n",
       "      <td>1</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>OH</td>\n",
       "      <td>107</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>Yes</td>\n",
       "      <td>26</td>\n",
       "      <td>161.6</td>\n",
       "      <td>123</td>\n",
       "      <td>27.47</td>\n",
       "      <td>195.5</td>\n",
       "      <td>103</td>\n",
       "      <td>16.62</td>\n",
       "      <td>254.4</td>\n",
       "      <td>103</td>\n",
       "      <td>11.45</td>\n",
       "      <td>13.7</td>\n",
       "      <td>3</td>\n",
       "      <td>3.70</td>\n",
       "      <td>1</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>NJ</td>\n",
       "      <td>137</td>\n",
       "      <td>415</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>243.4</td>\n",
       "      <td>114</td>\n",
       "      <td>41.38</td>\n",
       "      <td>121.2</td>\n",
       "      <td>110</td>\n",
       "      <td>10.30</td>\n",
       "      <td>162.6</td>\n",
       "      <td>104</td>\n",
       "      <td>7.32</td>\n",
       "      <td>12.2</td>\n",
       "      <td>5</td>\n",
       "      <td>3.29</td>\n",
       "      <td>0</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>OH</td>\n",
       "      <td>84</td>\n",
       "      <td>408</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>299.4</td>\n",
       "      <td>71</td>\n",
       "      <td>50.90</td>\n",
       "      <td>61.9</td>\n",
       "      <td>88</td>\n",
       "      <td>5.26</td>\n",
       "      <td>196.9</td>\n",
       "      <td>89</td>\n",
       "      <td>8.86</td>\n",
       "      <td>6.6</td>\n",
       "      <td>7</td>\n",
       "      <td>1.78</td>\n",
       "      <td>2</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>OK</td>\n",
       "      <td>75</td>\n",
       "      <td>415</td>\n",
       "      <td>Yes</td>\n",
       "      <td>No</td>\n",
       "      <td>0</td>\n",
       "      <td>166.7</td>\n",
       "      <td>113</td>\n",
       "      <td>28.34</td>\n",
       "      <td>148.3</td>\n",
       "      <td>122</td>\n",
       "      <td>12.61</td>\n",
       "      <td>186.9</td>\n",
       "      <td>121</td>\n",
       "      <td>8.41</td>\n",
       "      <td>10.1</td>\n",
       "      <td>3</td>\n",
       "      <td>2.73</td>\n",
       "      <td>3</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  State  Account length  Area code International plan Voice mail plan  \\\n",
       "0    KS             128        415                 No             Yes   \n",
       "1    OH             107        415                 No             Yes   \n",
       "2    NJ             137        415                 No              No   \n",
       "3    OH              84        408                Yes              No   \n",
       "4    OK              75        415                Yes              No   \n",
       "\n",
       "   Number vmail messages  Total day minutes  Total day calls  \\\n",
       "0                     25              265.1              110   \n",
       "1                     26              161.6              123   \n",
       "2                      0              243.4              114   \n",
       "3                      0              299.4               71   \n",
       "4                      0              166.7              113   \n",
       "\n",
       "   Total day charge  Total eve minutes  Total eve calls  Total eve charge  \\\n",
       "0             45.07              197.4               99             16.78   \n",
       "1             27.47              195.5              103             16.62   \n",
       "2             41.38              121.2              110             10.30   \n",
       "3             50.90               61.9               88              5.26   \n",
       "4             28.34              148.3              122             12.61   \n",
       "\n",
       "   Total night minutes  Total night calls  Total night charge  \\\n",
       "0                244.7                 91               11.01   \n",
       "1                254.4                103               11.45   \n",
       "2                162.6                104                7.32   \n",
       "3                196.9                 89                8.86   \n",
       "4                186.9                121                8.41   \n",
       "\n",
       "   Total intl minutes  Total intl calls  Total intl charge  \\\n",
       "0                10.0                 3               2.70   \n",
       "1                13.7                 3               3.70   \n",
       "2                12.2                 5               3.29   \n",
       "3                 6.6                 7               1.78   \n",
       "4                10.1                 3               2.73   \n",
       "\n",
       "   Customer service calls  Churn  \n",
       "0                       1  False  \n",
       "1                       1  False  \n",
       "2                       0  False  \n",
       "3                       2  False  \n",
       "4                       3  False  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"data/telecom_churn.csv\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3333, 20)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['State', 'Account length', 'Area code', 'International plan',\n",
       "       'Voice mail plan', 'Number vmail messages', 'Total day minutes',\n",
       "       'Total day calls', 'Total day charge', 'Total eve minutes',\n",
       "       'Total eve calls', 'Total eve charge', 'Total night minutes',\n",
       "       'Total night calls', 'Total night charge', 'Total intl minutes',\n",
       "       'Total intl calls', 'Total intl charge', 'Customer service calls',\n",
       "       'Churn'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 3333 entries, 0 to 3332\n",
      "Data columns (total 20 columns):\n",
      " #   Column                  Non-Null Count  Dtype  \n",
      "---  ------                  --------------  -----  \n",
      " 0   State                   3333 non-null   object \n",
      " 1   Account length          3333 non-null   int64  \n",
      " 2   Area code               3333 non-null   int64  \n",
      " 3   International plan      3333 non-null   object \n",
      " 4   Voice mail plan         3333 non-null   object \n",
      " 5   Number vmail messages   3333 non-null   int64  \n",
      " 6   Total day minutes       3333 non-null   float64\n",
      " 7   Total day calls         3333 non-null   int64  \n",
      " 8   Total day charge        3333 non-null   float64\n",
      " 9   Total eve minutes       3333 non-null   float64\n",
      " 10  Total eve calls         3333 non-null   int64  \n",
      " 11  Total eve charge        3333 non-null   float64\n",
      " 12  Total night minutes     3333 non-null   float64\n",
      " 13  Total night calls       3333 non-null   int64  \n",
      " 14  Total night charge      3333 non-null   float64\n",
      " 15  Total intl minutes      3333 non-null   float64\n",
      " 16  Total intl calls        3333 non-null   int64  \n",
      " 17  Total intl charge       3333 non-null   float64\n",
      " 18  Customer service calls  3333 non-null   int64  \n",
      " 19  Churn                   3333 non-null   bool   \n",
      "dtypes: bool(1), float64(8), int64(8), object(3)\n",
      "memory usage: 498.1+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 3333 entries, 0 to 3332\n",
      "Data columns (total 20 columns):\n",
      " #   Column                  Non-Null Count  Dtype  \n",
      "---  ------                  --------------  -----  \n",
      " 0   State                   3333 non-null   object \n",
      " 1   Account length          3333 non-null   int64  \n",
      " 2   Area code               3333 non-null   int64  \n",
      " 3   International plan      3333 non-null   object \n",
      " 4   Voice mail plan         3333 non-null   object \n",
      " 5   Number vmail messages   3333 non-null   int64  \n",
      " 6   Total day minutes       3333 non-null   float64\n",
      " 7   Total day calls         3333 non-null   int64  \n",
      " 8   Total day charge        3333 non-null   float64\n",
      " 9   Total eve minutes       3333 non-null   float64\n",
      " 10  Total eve calls         3333 non-null   int64  \n",
      " 11  Total eve charge        3333 non-null   float64\n",
      " 12  Total night minutes     3333 non-null   float64\n",
      " 13  Total night calls       3333 non-null   int64  \n",
      " 14  Total night charge      3333 non-null   float64\n",
      " 15  Total intl minutes      3333 non-null   float64\n",
      " 16  Total intl calls        3333 non-null   int64  \n",
      " 17  Total intl charge       3333 non-null   float64\n",
      " 18  Customer service calls  3333 non-null   int64  \n",
      " 19  Churn                   3333 non-null   int64  \n",
      "dtypes: float64(8), int64(9), object(3)\n",
      "memory usage: 520.9+ KB\n"
     ]
    }
   ],
   "source": [
    "df[\"Churn\"] = df[\"Churn\"].astype(\"int64\")\n",
    "df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Account length</th>\n",
       "      <th>Area code</th>\n",
       "      <th>Number vmail messages</th>\n",
       "      <th>Total day minutes</th>\n",
       "      <th>Total day calls</th>\n",
       "      <th>Total day charge</th>\n",
       "      <th>Total eve minutes</th>\n",
       "      <th>Total eve calls</th>\n",
       "      <th>Total eve charge</th>\n",
       "      <th>Total night minutes</th>\n",
       "      <th>Total night calls</th>\n",
       "      <th>Total night charge</th>\n",
       "      <th>Total intl minutes</th>\n",
       "      <th>Total intl calls</th>\n",
       "      <th>Total intl charge</th>\n",
       "      <th>Customer service calls</th>\n",
       "      <th>Churn</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "      <td>3333.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>101.06</td>\n",
       "      <td>437.18</td>\n",
       "      <td>8.10</td>\n",
       "      <td>179.78</td>\n",
       "      <td>100.44</td>\n",
       "      <td>30.56</td>\n",
       "      <td>200.98</td>\n",
       "      <td>100.11</td>\n",
       "      <td>17.08</td>\n",
       "      <td>200.87</td>\n",
       "      <td>100.11</td>\n",
       "      <td>9.04</td>\n",
       "      <td>10.24</td>\n",
       "      <td>4.48</td>\n",
       "      <td>2.76</td>\n",
       "      <td>1.56</td>\n",
       "      <td>0.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>39.82</td>\n",
       "      <td>42.37</td>\n",
       "      <td>13.69</td>\n",
       "      <td>54.47</td>\n",
       "      <td>20.07</td>\n",
       "      <td>9.26</td>\n",
       "      <td>50.71</td>\n",
       "      <td>19.92</td>\n",
       "      <td>4.31</td>\n",
       "      <td>50.57</td>\n",
       "      <td>19.57</td>\n",
       "      <td>2.28</td>\n",
       "      <td>2.79</td>\n",
       "      <td>2.46</td>\n",
       "      <td>0.75</td>\n",
       "      <td>1.32</td>\n",
       "      <td>0.35</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>1.00</td>\n",
       "      <td>408.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>23.20</td>\n",
       "      <td>33.00</td>\n",
       "      <td>1.04</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>74.00</td>\n",
       "      <td>408.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>143.70</td>\n",
       "      <td>87.00</td>\n",
       "      <td>24.43</td>\n",
       "      <td>166.60</td>\n",
       "      <td>87.00</td>\n",
       "      <td>14.16</td>\n",
       "      <td>167.00</td>\n",
       "      <td>87.00</td>\n",
       "      <td>7.52</td>\n",
       "      <td>8.50</td>\n",
       "      <td>3.00</td>\n",
       "      <td>2.30</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>101.00</td>\n",
       "      <td>415.00</td>\n",
       "      <td>0.00</td>\n",
       "      <td>179.40</td>\n",
       "      <td>101.00</td>\n",
       "      <td>30.50</td>\n",
       "      <td>201.40</td>\n",
       "      <td>100.00</td>\n",
       "      <td>17.12</td>\n",
       "      <td>201.20</td>\n",
       "      <td>100.00</td>\n",
       "      <td>9.05</td>\n",
       "      <td>10.30</td>\n",
       "      <td>4.00</td>\n",
       "      <td>2.78</td>\n",
       "      <td>1.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>127.00</td>\n",
       "      <td>510.00</td>\n",
       "      <td>20.00</td>\n",
       "      <td>216.40</td>\n",
       "      <td>114.00</td>\n",
       "      <td>36.79</td>\n",
       "      <td>235.30</td>\n",
       "      <td>114.00</td>\n",
       "      <td>20.00</td>\n",
       "      <td>235.30</td>\n",
       "      <td>113.00</td>\n",
       "      <td>10.59</td>\n",
       "      <td>12.10</td>\n",
       "      <td>6.00</td>\n",
       "      <td>3.27</td>\n",
       "      <td>2.00</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>243.00</td>\n",
       "      <td>510.00</td>\n",
       "      <td>51.00</td>\n",
       "      <td>350.80</td>\n",
       "      <td>165.00</td>\n",
       "      <td>59.64</td>\n",
       "      <td>363.70</td>\n",
       "      <td>170.00</td>\n",
       "      <td>30.91</td>\n",
       "      <td>395.00</td>\n",
       "      <td>175.00</td>\n",
       "      <td>17.77</td>\n",
       "      <td>20.00</td>\n",
       "      <td>20.00</td>\n",
       "      <td>5.40</td>\n",
       "      <td>9.00</td>\n",
       "      <td>1.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Account length  Area code  Number vmail messages  Total day minutes  \\\n",
       "count         3333.00    3333.00                3333.00            3333.00   \n",
       "mean           101.06     437.18                   8.10             179.78   \n",
       "std             39.82      42.37                  13.69              54.47   \n",
       "min              1.00     408.00                   0.00               0.00   \n",
       "25%             74.00     408.00                   0.00             143.70   \n",
       "50%            101.00     415.00                   0.00             179.40   \n",
       "75%            127.00     510.00                  20.00             216.40   \n",
       "max            243.00     510.00                  51.00             350.80   \n",
       "\n",
       "       Total day calls  Total day charge  Total eve minutes  Total eve calls  \\\n",
       "count          3333.00           3333.00            3333.00          3333.00   \n",
       "mean            100.44             30.56             200.98           100.11   \n",
       "std              20.07              9.26              50.71            19.92   \n",
       "min               0.00              0.00               0.00             0.00   \n",
       "25%              87.00             24.43             166.60            87.00   \n",
       "50%             101.00             30.50             201.40           100.00   \n",
       "75%             114.00             36.79             235.30           114.00   \n",
       "max             165.00             59.64             363.70           170.00   \n",
       "\n",
       "       Total eve charge  Total night minutes  Total night calls  \\\n",
       "count           3333.00              3333.00            3333.00   \n",
       "mean              17.08               200.87             100.11   \n",
       "std                4.31                50.57              19.57   \n",
       "min                0.00                23.20              33.00   \n",
       "25%               14.16               167.00              87.00   \n",
       "50%               17.12               201.20             100.00   \n",
       "75%               20.00               235.30             113.00   \n",
       "max               30.91               395.00             175.00   \n",
       "\n",
       "       Total night charge  Total intl minutes  Total intl calls  \\\n",
       "count             3333.00             3333.00           3333.00   \n",
       "mean                 9.04               10.24              4.48   \n",
       "std                  2.28                2.79              2.46   \n",
       "min                  1.04                0.00              0.00   \n",
       "25%                  7.52                8.50              3.00   \n",
       "50%                  9.05               10.30              4.00   \n",
       "75%                 10.59               12.10              6.00   \n",
       "max                 17.77               20.00             20.00   \n",
       "\n",
       "       Total intl charge  Customer service calls    Churn  \n",
       "count            3333.00                 3333.00  3333.00  \n",
       "mean                2.76                    1.56     0.14  \n",
       "std                 0.75                    1.32     0.35  \n",
       "min                 0.00                    0.00     0.00  \n",
       "25%                 2.30                    1.00     0.00  \n",
       "50%                 2.78                    1.00     0.00  \n",
       "75%                 3.27                    2.00     0.00  \n",
       "max                 5.40                    9.00     1.00  "
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>State</th>\n",
       "      <th>International plan</th>\n",
       "      <th>Voice mail plan</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>3333</td>\n",
       "      <td>3333</td>\n",
       "      <td>3333</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>unique</th>\n",
       "      <td>51</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>top</th>\n",
       "      <td>WV</td>\n",
       "      <td>No</td>\n",
       "      <td>No</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>freq</th>\n",
       "      <td>106</td>\n",
       "      <td>3010</td>\n",
       "      <td>2411</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       State International plan Voice mail plan\n",
       "count   3333               3333            3333\n",
       "unique    51                  2               2\n",
       "top       WV                 No              No\n",
       "freq     106               3010            2411"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe(include=['bool','object'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Churn\n",
       "0    2850\n",
       "1     483\n",
       "Name: count, dtype: int64"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Churn\"].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Churn\n",
       "0    0.86\n",
       "1    0.14\n",
       "Name: proportion, dtype: float64"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"Churn\"].value_counts(normalize=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "myven",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
